package top.hzy520.role.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.hzy520.role.dto.PermissionOutPutDto;
import top.hzy520.role.entity.Role;

import java.util.List;

@Mapper
public interface RoleMapper {
    int deleteByPrimaryKey(Long roleId);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long roleId);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    int selectAllRoleCount();

    List<Role> selectAllRole(@Param("offset") int offset,@Param("limit") int limit);

    Role selectById(Long roleId);

    void deleteByRoleId(Long roleId);

    void insertRole(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    List<Role> selectRole();

    void insertRoleAndUser(@Param("userId") Long userId, @Param("roleId") Long roleId);

    void updateUserRole(@Param("roleId") Long roleId,@Param("userId") Long userId);
}